#include "HString.h"
void main()
{
	HString s0("I love you!"),s1;
	cout<<"Be initialized by char *,s0:"<<s0;
	cout<<"Be constructed by default constructor,s1:"<<s1;

	s1=s0;
	cout<<"= overload S1:"<<s1;

	HString s2=s1;
	cout<<" copy constructor,s2:"<<s2;
    
	s2=s0+s1;
	cout<<"The member function:overload +:"<<s2;
     
	s1+=(s2+=s0);
	cout<<"The member function:overload +=:"<<s2;
    cout<<"The member function:overload +=:"<<s1;

	s1=s2(3,4);
	cout<<"The member function:()overload:"<<s1;

	cout<<"s2:"<<s2;
	cout<<"s1:"<<s1;
	cout<<"First position of s1 in s2:"<<s2.Index(s1,0)<<endl;
	cout<<"Second position of s1 in s2:"<<s2.Index(s1,6)<<endl;

	if(StrCompare(s2,s1))
		cout<<"The function StrCompare:S2 >s1"<<endl;

	s1[10]='p';
	cout<<"After use operator[] of s1:"<<s1;

	if(!(s1==s2))
	cout<<"== overload : s1!=s2.";
}